<template>
  <div>
    <basic-table
      :table-title="tableTitle"
      :data-source="dataSource"
      :data-params="dataParams"
      :multiple-table="false"
      class="mt-4"
    >
      <template v-slot:chack="scope">
        <span style="color: #0087FE; cursor: pointer;" @click="changeStatus(scope.row)">
          查看
        </span>
      </template>
    </basic-table>

    <Modal
      :show="dialogVisible"
      :descriptions-info="descInfo"
      :descriptions-list="descriptionsList"
      @close="close"
    />
  </div>
</template>
<script>
import BasicTable from '@/components/BasicTable/index.vue'
import Modal from '@/components/Modal/Index'

import { getMonomerInfo, getMonomerDetail } from '@/api/project'

export default {
  name: 'BasicInfos',
  components: { BasicTable, Modal },
  props: {
    projectId: { type: String, default: '' }
  },
  data() {
    return {
      dialogVisible: false,
      dataSource: () => getMonomerInfo,
      dataParams: {},
      tableTitle: [
        {
          label: '单体建（构）筑物名称',
          value: 'MonomerBuildName',
          show: true,
          type: 'text'
        },
        {
          label: '工程总造价（万元）',
          value: 'ProInvest',
          show: true,
          type: 'text'
        },
        {
          label: '建筑面积（平方米）',
          value: 'BuildArea',
          show: true,
          type: 'text'
        },
        {
          label: '建筑高度（米）',
          value: 'BuildHeight',
          show: true,
          type: 'text'
        },
        {
          label: '结构体系',
          value: 'StructureType',
          show: true,
          type: 'text'
        },
        {
          label: '工程等级',
          value: 'ProLevel',
          show: true,
          type: 'text'
        },
        {
          label: '详情',
          show: true,
          type: 'slot',
          slot: 'chack'
        }
      ],
      descriptionsList: {
        'SubPrjName': '单体建筑物名称',
        'UnitCode': '单体编号',
        'Invest': '工程总造价(万元)',
        'BuildArea': '建筑面积(平米)',
        'FloorBuildArea': '地上建筑面积(平米)',
        'UnderFloorBuildArea': '地下建筑面积(平米)',
        'FloorCount': '地面层数',
        'UnderFloorCount': '地下层数',
        'BuildHeight': '建筑高度(米)',
        'Length': '长度(米)',
        'Span': '跨度(米)',
        'StructureType': '结构体系',
        'ProjectLevel': '工程等级',
        'RfBottomArea': '人防地下室面积',
        'ProjectSize': '工程规模',
        'Memo': '其他',
        'TenderNum': '招投标环节编号',
        'CensorNum': '施工图审查环节编号',
        'BuildErlicenceNum': '施工许可环节编号',
        'QualityNum': '质量监督环节编号',
        'SafeNum': '安全监督环节编号',
        'IsLessShockBuild': '是否为减隔震建筑',
        'IsGreenBuild': '是否为绿色建筑',
        'GreenBuildLevel': '绿色建筑等级',
        'SeismicintenSityScale': '抗震设防烈度',
        'IsuperHightBuild': '是否超限高层建筑',
        'SuiteCount': '住宅套数(户)',
        'StructureHeight': '构筑物高度(米)',
        'SingleSpanRc': '单跨（钢筋混凝土结构）(米)',
        'SingleSpanHs': '单跨（重钢结构）(米)'
      },
      descInfo: null
    }
  },
  created() {
    this.dataParams.projectId = this.projectId
  },
  methods: {
    close(v) {
      this.dialogVisible = v
    },
    //  查看
    changeStatus(v) {
      getMonomerDetail({
        id: v.Id,
        projectId: this.projectId
      }).then(res => {
        if (res.code === 200) {
          this.dialogVisible = true
          this.descInfo = res.data.detail
        }
      })
    }
  }
}
</script>

<style scoped>

</style>
